﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using PMP.Models.Shared;

namespace PMP.Common
{
    public static class ControllerExtension
    {
        public static ViewResult Err(this Controller controller, string msg)
        {
            return controller.View(new ErrorModel { Msg = msg });
        }
        public static ViewResult Err(this Controller controller, string title, string msg)
        {
            return controller.View(new ErrorModel { Title = title, Msg = msg });
        }
        public static ViewResult Err(this Controller controller, string title, string msg, string urlname, string url)
        {
            return controller.View(new ErrorModel { Title = title, Msg = msg, UrlName = urlname, Url = url });
        }
    }
}
